package com.continuing.web.controller.beef;

import com.continuing.beef.service.BeefCommonService;
import com.continuing.common.core.controller.BaseController;
import com.continuing.common.core.page.TableDataInfo;
import com.continuing.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;

/**
 * beef通用Controller
 */
@RestController
@RequestMapping("/beef/common")
public class BeefCommonController extends BaseController {


    @Autowired
    private BeefCommonService beefCommonService;

    @Autowired
    private TokenService tokenService;


    /**
     * 查询客户信息
     */
    @PreAuthorize("@ss.hasPermi('beef:bill:list')")
    @GetMapping("/clientUser")
    public TableDataInfo clientUser(HttpServletRequest request) {
        return getDataTable(beefCommonService.clientUser(
                tokenService.getLoginUser(request).getDeptId()
        ));
    }


}
